<template>
	<common-list :isDataEmpty="tableData.length === 0" :isLoad="isLoad" :status="status">
		<template #list>
			<view>
				<view class="car-list">
					<view class="car-item" v-for="(item, index) in tableData" :key="index">
						<car-card :isTui="isTui" :demandId="demandId" :info="item" @backInfo="backInfo" />
					</view>
				</view>
			</view>
		</template>
	</common-list>
</template>

<script setup>
	import {
		ref,
		defineProps,
		defineEmits
	} from 'vue'
	import CommonList from '@/components/commonList/list.vue'
	import CarCard from '@/components/card/CarCard.vue'
	defineProps({
		tableData: {
			type: Array,
			default: () => []
		},
		status: {
			type: String,
			default: ''
		},
		demandId: {
			type: Number,
			default: 0
		},
		isLoad: {
			type: Boolean,
			default: true
		},
		isTui: {
			type: Boolean,
			default: false
		}
	})
	const emit = defineEmits('backInfo')

	const backInfo = (e) => {
		emit('backInfo', e)
	}
</script>

<style lang="scss" scoped>
	.car-list {
		padding: 20rpx 24rpx;

		.car-item {
			&:not(:first-child) {
				margin-top: 40rpx;
			}
		}
	}
</style>